<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="umsroot.css">
<TITLE>
Other tips
</TITLE>
</HEAD>
<BODY >
<A HREF="umsroot016.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot008.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc33">3.9</A>&nbsp;&nbsp;Other tips</H2><UL>
<LI><A HREF="umsroot017.html#toc18">Initialisation at start-up</A>
<LI><A HREF="umsroot017.html#toc19">Recommended file names</A>
</UL>


<A NAME="toc18"></A>
<H3 CLASS="subsection"><A NAME="htoc34">3.9.1</A>&nbsp;&nbsp;Initialisation at start-up</H3>
If you wish to have ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> do or execute things at startup time, you
can achieve this in TkECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> by setting the initial query call in the
Preference editor; and in the command-line <TT>eclipse</TT> by putting via a
<TT>.eclipserc</TT> file.<BR>
<BR>
For <TT>eclipse</TT>,
before displaying the initial prompt, the system checks whether there is a file
called <TT>.eclipserc</TT><A NAME="@default126"></A><A NAME="@default127"></A><A NAME="eclipserc"></A>
in the current directory and if not, in the user's home
directory. If such a file is found, ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> compiles it first.
Thus it is possible to put various initialisation commands into
this file.
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> has many possibilities to change its default behaviour and
setting up a <TT>.eclipserc</TT> file is a convenient way to achieve this.
A different name for the initialisation file can be specified
in the environment variable <TT>ECLIPSEINIT</TT><A NAME="@default128"></A>.
If <TT>ECLIPSEINIT</TT> is set to an empty string, no initialisation is done.
If the system is started with a -e option, then the <TT>.eclipserc</TT> file
is ignored.<BR>
<BR>
For TkECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>, the system will make the initial query call as set in the
Preference Editor before giving control to the user. This call can be set
to compile an initialisation file. This can be the <TT>.eclipserc</TT> file,
or some other file if the user wants to initialise the system differently in
TkECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>.<BR>
<BR>
<A NAME="toc19"></A>
<H3 CLASS="subsection"><A NAME="htoc35">3.9.2</A>&nbsp;&nbsp;Recommended file names</H3>
It is recommended programming practice to give the Prolog source programs
the suffix <TT>.pl</TT>, or <TT>.ecl</TT> if it contains ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> specific
code.
It is not enforced by the system, but it simplifies managing the source
programs.
The <A HREF="../bips/kernel/compiler/compile-1.html"><B>compile/1</B></A><A NAME="@default129"></A> predicate
automatically adds the suffix to the
filename, so that it does not need to be specified;
if the literal filename can not be found, the system tries appending
each of the valid suffixes in turn and tries to find the resulting filename.
The system's list of valid Prolog suffixes is in the global flag
<B>prolog_suffix</B><A NAME="@default130"></A> and can be examined and modified
using <A HREF="../bips/kernel/env/get_flag-2.html"><B>get_flag/2</B></A><A NAME="@default131"></A> and
<A HREF="../bips/kernel/env/set_flag-2.html"><B>set_flag/2</B></A><A NAME="@default132"></A>.
For example, to add the new suffix &#8220;.pro&#8221; use:
<BLOCKQUOTE CLASS="quote">
<PRE CLASS="verbatim">
get_flag(prolog_suffix, Old), set_flag(prolog_suffix, [".pro"|Old]).
</PRE></BLOCKQUOTE>
<HR>
<A HREF="umsroot016.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot008.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
</BODY>
</HTML>
